package com.mzpai.product.service.impl;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mzpai.product.mapper.SystemSettingMapper;
import com.mzpai.product.model.SystemSetting;
import com.mzpai.product.service.SystemSettingService;
import com.mzpai.service.impl.BaseServiceImpl;
/**
 *
 * <b>配置信息表 | Service</b><br>
 *
 * yanglijun 2021-05-15 00:12:38
 * 
 *  @version 1.0.0
 *
 */
@Service
public class SystemSettingServiceImpl extends BaseServiceImpl<SystemSetting> implements SystemSettingService {

	Logger logger = LoggerFactory.getLogger(SystemSetting.class);

	@Autowired 
	private SystemSettingMapper mapper;
	
	@Override
	public SystemSetting getSettingByCode(String code) {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("code", code);
		List<SystemSetting> list = mapper.getList(map);
		if(list.isEmpty()) {
			return null;
		}
		return list.get(0);
	}
}